package edu.mapi.ir.viewer;

import java.awt.Shape;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Point2D;
import java.awt.geom.Line2D.Double;

/**
 * @author ZP
 */
public class Beacon {

	private double height = 1.7;
	private Point2D position = new Point2D.Double();
	private Point2D targetCenter = new Point2D.Double();
	private double radius = 1.0;
	
	public double getHeight() {
		return height;
	}
	public void setHeight(double height) {
		this.height = height;
	}
	public Point2D getPosition() {
		return position;
	}
	public void setPosition(Point2D position) {
		this.position = position;
	}
	public double getRadius() {
		return radius;
	}
	public void setRadius(double radius) {
		this.radius = radius;
	}
	
	public Shape getShape() {
		return new Ellipse2D.Double(targetCenter.getX()-radius, targetCenter.getY()-radius, radius*2, radius*2); 
	}
	
	@Override
	public String toString() {
		return "\t<Beacon X=\""+getPosition().getX()+"\" Y=\""+getPosition().getY()+"\" Height=\""+getHeight()+"\" />\n"+
		"\t<Target X=\""+getTargetCenter().getX()+"\" Y=\""+getTargetCenter().getY()+"\" Radius=\""+getRadius()+"\" />\n";
		
	}
	public Point2D getTargetCenter() {
		return targetCenter;
	}
	public void setTargetCenter(Point2D targetCenter) {
		this.targetCenter = targetCenter;
	}
	
}
